<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
  <div class="w790">
  <script>
  	function uploaded(path){
		$("#img_url").attr("src",'__PUBLIC__'+path);
		$("input[name='img_url']").val(path);
	}
	function del_img(){
		if(confirm('您确定要删除图片吗?')){
			var file=$("input[name='img_url']").val();
			$.post("{:U('delImgBypath')}",{'path':file},function(data){
				$("input[name='img_url']").val('');
				$("#img_url").attr('src','');
			});
		}else{
			return false;
		}
	}
	
	//删除图组图片
	function mdel_img(path){
		$('#img_list div img').each(function(index, element) {
			$.post("{:U('delImgBypath')}",{'path':path},function(data){
				if(data=='OK'){
					 
					$('#img_list div').each(function(index, element) {
                        if($(this).attr('url')==path){
							$(this).remove();
						}
                    });
					
					$('#picmsg input').each(function(index, element) {
                        if($(this).val()==path){
							$(this).remove();
						}
                    });
				}
			});
		});
	}
	
	
	
	
	
	
	
	
	function relateids(){
				art.dialog.data('relateidsBox',$('#relateids'));
				
				
				art.dialog.open('{:U('selectProduct', array('product_id' => $info['id']))}', {width: 800, height: 500,lock:true,title:'选择关联商品', ok:function(){
					var d = this.iframe.contentWindow.document;
					
			    }});
			}
	
	
	

	
	$(document).ready(function(e) {
    $('#control li').each(function(index, element) {
        $(this).click(function(e) {
			$(this).parent().find('li').removeClass('cur');
            $(this).addClass('cur');
			$('.setting_table').hide();
			$('.setting_table').eq(index).show();
        });
    });
});

	
	
	
	
	
	
	
	
	
	
	
	//切换栏目方式 
	function parseCateType(e){
		if($(e).val()==1){
			$('#pagesize').show();
		}else{
			$('#pagesize').hide();
		}
	}
	function after(e){
	    $(e).parent().parent().parent().parent().parent('li').after($(e).parent().parent().parent().parent().parent('li').prev());
    }
    function append(e){
	    $(e).parent().parent().parent().parent().parent('li').next().after($(e).parent().parent().parent().parent().parent('li'));
    }
	function delnews(e){
		$(e).parent().parent().parent().parent().parent().remove();
	}
	function addnews(){
		var html = $('#copyHTML').html();
		$(html).appendTo('#replyList ul');
	}
  </script>
  <style>
  	#replyList ul li{margin-top:5px; background:#eee; padding:8px; width:700px;}
	.delnews{display:block; width:30px; font-size:20px; height:30px; border-radius:15px; background:#f00; color:#fff; line-height:30px; text-align:center;}
  </style>

 <div class="h"><a href="{:U('index')}" class="btn btn-info"><i class="glyphicon glyphicon-circle-arrow-left"></i> 返回列表</a>
 
 </div>
 <style>#control{border-bottom:1px solid #558fca; margin-bottom:10px;}
		#control li{float:left; height:40px; line-height:40px; border:1px solid #558fca; border-bottom:none;}
		#control li a{padding:0px 8px;}
		#control li.cur{background:#558fca;}
		#control li.cur a{color:#fff; font-weight:bold;}
		.relateListdel{display:inline-block; width:20px; height:20px; text-align:center; font-size:18px; cursor:default;}
	</style>
   <ul id="control"><li class="cur"><a href="javascript:void(0);">返现配置</a></li>
   <volist name="extendsField" id="vo">
   	<li><a href="javascript:void(0);">{$vo.title}</a></li>
   </volist>
   <div class="clear"></div>
   </ul>
 
    <form class="checkoutform form-horizontal" action="{:U('update')}" method="post">
      <div class="table_ container">
      
      <input type="hidden" name="id" value="{$info.id}">
      
      
  
     <div class="setting_table">
   <div class="form-group">
      <label class="col-sm-2 control-label">返现规则名称</label>
      <div class="col-sm-10">
         <input class="form-control" datatype="*"  name="title" value="{$info.title}" id="title" type="text">
      </div>
   </div>
   <div class="form-group">
      <label class="col-sm-2 control-label">是否开启返现</label>
      <div class="col-sm-10">
         <label class="checkbox-inline"> <input name="status" type="radio" id="is_nav_8" value="1" <eq name="info['status']" value="1">checked="checked"</eq> />
          是</label>
          <label class="checkbox-inline">  <input name="status" type="radio" id="is_nav_9" value="0"  <eq name="info['status']" value="0">checked="checked"</eq> />
          否</label>
      </div>
   </div>
   
  <div class="form-group">
      <label class="col-sm-2 control-label">基础返现率(单位：万分之一)</label>
      <div class="col-sm-10">
         <input class="form-control" datatype="*"  name="rate" value="{$info.rate}" id="rate" type="text">
      </div>
   </div>
   
   <div class="form-group">
      <label class="col-sm-2 control-label">日返率调整间隔天数</label>
      <div class="col-sm-10">
         <input class="form-control" datatype="*"  name="adjust_time" value="{$info.adjust_time}" id="adjust_time" type="text">
      </div>
   </div>

   <div class="form-group">
      <label class="col-sm-2 control-label">返现提示语(必须有"返现"二字，否则搜索不到日志结果)</label>
      <div class="col-sm-10">
         <input class="form-control" datatype="*"  name="remark" value="{$info.remark}" id="remark" type="text">
      </div>
   </div>
<div class="form-group">
      <label class="col-sm-2 control-label">返现商品</label>
      <div class="col-sm-10">
      <div id="relateids"><volist name="relatelist" id="vo">
      <gt name="vo" value="0">
      <div class="col-sm-3 col-md-3" style="position:relative;"><div class="thumbnail" id="thumbnail_{$vo.id}">
          <img alt="100%x200" src="{:getThumbPath($vo['img_url'])}" data-holder-rendered="true" style="width: 100%; display: block;">
          <div class="caption">
            <h3 style="font-size:12px;">{$vo['title']}</h3>
            <input type="hidden" name="relateids" value="{$vo.id}">
          </div>
        </div><a style="position:absolute; top:0px; right:10px; display:inline-block; width:30px; height:30px; line-height:30px; text-align:center; background:#f00; color:#fff;" onClick="$(this).parent().remove();" href="##">x</a></div>
      </gt>
      </volist></div>
      
      <a onClick="relateids();" class="btn btn-success">更改</a>
      </div>
   </div>
  </div>
      
        
      </div><div class="pages"><button type="submit" class="btn btn-success">保存</button></div>
    </form>
  </div>
  <div class="clear"></div>
</div>

</body></html>